<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
        <fieldset id="custom_data">
            <legend>支持各种类型的数据</legend>
            <div class="form">
                <dl class="row">
                    <dt>一</dt>
                    <dd><select class="first select"></select></dd>
                </dl>
                <dl class="row">
                    <dt>二</dt>
                    <dd><select class="second select"></select></dd>
                </dl>
                <dl class="row">
                    <dt>三</dt>
                    <dd><select class="third select"></select></dd>
                </dl>

            </div>
        </fieldset>
    </body>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
    <script th:src="@{/jquery.cxselect.min.js}"></script>
    <script>
        $('#custom_datas').cxSelect({
            selects: ['first', 'second', 'third'],
            required: true,
            jsonValue: 'v',
            data: [{
                'v': '1', 'n': '第一级 >', 's': [
                    {
                        'v': '2', 'n': '第二级 >', 's': [
                            {'v': '3', 'n': '第三级 >', 's': []}
                        ]
                    }
                ]
            }]
        });
        $.cxSelect.defaults.url = 'customData';
        $(function () {
            $('#custom_data').cxSelect({
                selects: ['first', 'second', 'third']
            });
        });
    </script>
</html>
